#pragma once


#include <interface/interface.h>
//#include <map>
//#include <string>
#include <interface/interface_wrapper.h>
#include <interface/global_data_wrapper.h>
#include "p2pft_client_impl.h"

class multi_lang_impl;

class dll_object : public virtual aot::tt::idll
{
public:
	dll_object();
	virtual ~dll_object();

public:
	virtual void destroy();
	virtual bool query_interface(void** out, const char* key);
	virtual const char* interface_name(){return "idll.p2pft_client.dll";}

public:
	virtual const char* module_name(){return "p2pft_client.dll";}
	virtual bool on_regist(aot::tt::idll::dll_regist_param_t* p, aot::tt::result_t* ret);
	virtual int on_putq (aot::tt::message_t* msg, long tm = -1, aot::tt::result_t* ret = NULL);
	virtual int on_command (aot::tt::command_t* cmd, aot::tt::result_t* ret = NULL);

public:
	static aot::tt::imain*	im_;
	static multi_lang_impl  multi_lang_impl_;

	global_data_wrapper global_;
	interface_wrapper i_wrapper_;
	HWND parent_wnd_;
	p2pft_client_impl* ptr_ft_client_;
};


// #define aot_trace(level, fmt, ...) \
// 	aot_log_debug(level, "%s -> %s: "#fmt, \
// 	get_class(), __FUNCTION__, __VA_ARGS__ )\

extern dll_object* g_dll_obj;

global_data_wrapper* get_global();
interface_wrapper* get_interface();
